﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BuySoftwareOnline.Domain.Abstract;

namespace BuySoftwareOnline.Domain.Concrete
{
    public class ProductBuildRepository : IProductBuildRepository
    {
        private BuySoftwareOnlineDataContext context;

        public ProductBuildRepository()
        {
            context = new BuySoftwareOnlineDataContext();
        }

        public IQueryable<ProductBuild>  ProductBuilds
        {
            get
            {
                return context.ProductBuilds;
            }
        }

        public void SaveProductBuild(ProductBuild productbuild)
        {
            context.ProductBuilds.InsertOnSubmit(productbuild);
            context.SubmitChanges();
        }

        public void DeleteProductBuild(ProductBuild productbuild)
        {
            context.ProductBuilds.DeleteOnSubmit(productbuild);
            context.SubmitChanges();
        }
    }
}
